<core:set title='Orders'/>
<core:WRAP file="admin_page.html" as="content">

<active_record:fetch using='src/model/Order' find='for_admin' target="orders" navigator='pager' order='date=DESC'/>

<p/><b>Filter orders:</b>
<form method="GET" id='filter_form' runat='server'>

<?php
$template->setChildDatasource('status_options_source', Order :: getStatusOptions());
?>

  <select:options_source id='status_options_source' target='status' default_value='0' default_name='Show all'/>
Filter : <select id='status' name='status' runat='server'>
    </select>
  <input type='submit' name='filter' value="Filter" class='button'/><br/>
</form>

<core:include file='pager.html'/>

<list:list id="orders">
<table cellpadding="0" cellspacing="0" class='list'>
  <thead>
  <tr>
    <th>Date</th>
    <th>Status</th>
    <th>Summ</th>
    <th>Actions</th>
  </tr>
  </thead>
  <list:item>
  <tr class='{$Parity}'>
   <td><route_url params="action:details,id:{$id}">{$date|date:"F j, Y, G:i"}</route_url></td>
   <td>{$status_name}</td>
   <td>${$summ|number:2, '.'}</td>
   <td>
     <route_url params="action:delete,id:{$id}">Delete</route_url>
   </td>
  </tr>
  </list:item>
</table>
</list:list>

</core:wrap>
